﻿<!--*************************************************************************************

   Toolkit for WPF

   Copyright (C) 2007-2016 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  ***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views.ButtonSpinnerView"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
                 xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                 xmlns:s="clr-namespace:System;assembly=mscorlib"
                 Title="ButtonSpinner">
     <local:DemoView.Description>
        <Paragraph FontSize="14" FontFamily="Segoe">
            The ButtonSpinner control allows you to add button spinners to any element and then respond to the Spin event to manipulate that element. The Spin event lets the developer know which direction the buttons are spinning; SpinDirection.Increase indicates an increment, SpinDirection.Decrease indicates a decrement.
        </Paragraph>
    </local:DemoView.Description>

   <local:DemoView.Resources>

      <x:Array x:Key="names" Type="s:String">
         <s:String>John Smith</s:String>
         <s:String>Janel Leverling</s:String>
         <s:String>Laura Callahan</s:String>
         <s:String>Robert King</s:String>
         <s:String>Margaret Peacock</s:String>
         <s:String>Andrew Fuller</s:String>
         <s:String>Anne Dodsworth</s:String>
         <s:String>Nancy Davolio</s:String>
         <s:String>Naomi Suyama</s:String>
      </x:Array>       
   </local:DemoView.Resources>

   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto" />
         <RowDefinition Height="*" />
      </Grid.RowDefinitions>

      <GroupBox Header="Features" Grid.Row="0" Margin="5">
         <Grid Margin="5">
            <Grid.RowDefinitions>
               <RowDefinition Height="Auto" />
               <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto" />
               <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <TextBlock Text="AllowSpin:" VerticalAlignment="Center" />
            <CheckBox x:Name="_allowSpin" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="When true allows the ButtonSpinner to perform increment/decrement operations." />

            <TextBlock Text="ShowButtonSpinner:" VerticalAlignment="Center" Grid.Row="1" />
            <CheckBox x:Name="_showButtonSpinner" Grid.Row="1" Grid.Column="1" IsChecked="True" VerticalAlignment="Center" Margin="5" ToolTip="Gets/Sets the visibility of the button spinners." />
         </Grid>
      </GroupBox>

      <StackPanel Grid.Row="1" Margin="10">
         <TextBlock Text="Usage:" Style="{StaticResource Header}" />
         <TextBlock Text="You can wrap any element by placing it inside the content area of the ButtonSpinner control."
                    TextWrapping="Wrap" />

         <xctk:ButtonSpinner Margin="10" 
                             Width="150" 
                             HorizontalAlignment="Left"
                             AllowSpin="{Binding IsChecked, ElementName=_allowSpin}"
                             ShowButtonSpinner="{Binding IsChecked, ElementName=_showButtonSpinner}"
                             Spin="ButtonSpinner_Spin">
            <TextBox Text="John Smith" IsReadOnly="True" BorderThickness="0" HorizontalContentAlignment="Right" />
         </xctk:ButtonSpinner>
      </StackPanel>
   </Grid>
</local:DemoView>
